package org.tinygroup.uiml.metadata;

import org.tinygroup.commons.tools.EqualsUtil;
import org.tinygroup.commons.tools.HashCodeUtil;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

/**
 * 属性列表
 * Created by luoguo on 2014/6/30.
 */
@XStreamAlias("property-type")
public final class PropertyType {
    /**
     * 名字
     */
	@XStreamAsAttribute
    private String name;
    /**
     * 标题
     */
	@XStreamAsAttribute
    private String title;
    /**
     * 输入类型
     */
	@XStreamAsAttribute
    private String type;
    /**
     * 设置控件的默认值，如果控件没有指定值(NULL)，""表示是有值的
     */
	@XStreamAsAttribute
	@XStreamAlias("default-value")
    private String defaultValue;
    /**
     * 短描述
     */
	@XStreamAlias("short-description")
    private String shortDescription;
    /**
     * 长描述
     */
    private String description;

    @XStreamAsAttribute
    private String category;

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getShortDescription() {
        return shortDescription;
    }

    public void setShortDescription(String shortDescription) {
        this.shortDescription = shortDescription;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public int hashCode() {
		return HashCodeUtil.reflectionCompareHashCode(this, new String[]{"name","category"});
	}

	public boolean equals(Object obj) {
	   return EqualsUtil.reflectionCompareEquals(this, obj, new String[]{"name","category"});
	}
	
    
}
